# provision a new koji bkernel 
# NOTE: this assumes the bkernel boxes are already up and are accessible
# NOTE: most of these vars_path come from group_vars/bkernel or from hostvars

- name: make koji bkernel
  hosts: bkernel
  user: root
  gather_facts: True

  vars_files: 
   - /srv/web/infra/ansible/vars/global.yml
   - "{{ private }}/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  roles:
  - base
  - koji_builder

  tasks:
  - include: "{{ tasks }}/koji/builder_kernel_config.yml"
  - include: "{{ tasks }}/koji/bkernel-setup.yml"

  handlers:
  - include: "{{ handlers }}/restart_services.yml"

  - name: restart kojid
    action: service name=kojid state=restarted
